﻿@using RunCoachWebApplication.Models;
@using RunCoachWebApplication.RunCoachServiceReference;

@model List<Runs>

@{
    ViewBag.Title = "Activities";
}

<h2>@ViewBag.Title</h2>



<table>
    <tr>
        <th>Start Time</th>
        <th>End Time</th>
        <th>Distance</th>
        <th>Avg Pace</th>
        <th>&nbsp;</th>
        <th>&nbsp;</th>
    </tr>

    @foreach (Runs run in Model)
    {
        <tr>
            <td>@run.start_time.ToString()</td>
            <td>@run.end_time.ToString()</td>
            <td>@run.distance.ToString() km</td>
            <td>@run.avg_speed.ToString() min/km</td>
            <td>@Html.ActionLink("Details", "AnActivity", new { RunId = run.id })</td>
            <td>@Html.ActionLink("Delete", "Delete", new { RunId = run.id }, 
                new { onclick = "return confirm('Are you sure you want to delete this activity?')" })</td>
        </tr>
    }
</table>